package com.jiazhong.basic.pack0316.thread.work02;

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class App {
    public static void main(String[] args) {
        Lock lock = new ReentrantLock();
        Well well = new Well(lock);
        People p1 = new People(well);
        People p2 = new People(well);
        People p3 = new People(well);
        People p4 = new People(well);
        Thread t1 = new Thread(p1);
        t1.setName("张三");
        Thread t2 = new Thread(p2);
        t2.setName("李四");
        Thread t3 = new Thread(p3);
        t3.setName("王五");
        Thread t4 = new Thread(p4);
        t4.setName("马六");
        t1.start();
        t2.start();
        t3.start();
        t4.start();
    }
}
